package cn.zjutleo.village_server.controller;

import cn.zjutleo.village_server.service.JsonService;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: 张坤
 * @DateTime: 2021/9/7 23:35
 * @Description: 该类用于 TODO
 */
@Api("json数据查询")
@RestController
@RequestMapping("/api/json")
public class JsonController {
    @Resource
    private JsonService jsonService;

    @ApiOperation("地图数据查询")
    @GetMapping("/map/{jsonMapName}")
    String getMapData(@PathVariable String jsonMapName){
        return jsonService.getMapJson(jsonMapName);
    }
    @ApiOperation("省市区镇村信息数据查询")
    @GetMapping("/areaInfo/{areaCode}")
    String getAreaInfo(@PathVariable String areaCode){
        return jsonService.getAreaInfo(areaCode);
    }
    @ApiOperation("公交信息数据查询")
    @GetMapping("/busInfo/{busInfo}")
    String getBusInfo(@PathVariable String busInfo){
        return jsonService.getBusInfo(busInfo);
    }
}
